package com.ruoyi.bizsys.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.bizsys.domain.ExtMonnifyOrder;
import com.ruoyi.bizsys.domain.ProductInfo;
import com.ruoyi.bizsys.domain.RepaymentOrder;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 还款管理Mapper接口
 *
 * @author african-loan
 * @date 2021-12-30
 */
public interface RepaymentOrderMapper extends BaseMapper<RepaymentOrder>{

    int getWithholdCardCount(@Param("custNo") String custNo);
    void updateByRepayNo(RepaymentOrder repaymentOrder);

    RepaymentOrder getDetail(String repaymentNo);

    RepaymentOrder getDetailByVo(RepaymentOrder repaymentOrder);

    /**
     * repay_status =5 state =1 payTransSerialNo
     * @param serialNo
     * @return
     */
    RepaymentOrder getDetailByPayTransSerialNo(String serialNo);

    RepaymentOrder getMaxPayTime(String loanSerialNo);

    void updateRepaymentOrderReomveReduceById(RepaymentOrder repaymentOrder);

    RepaymentOrder getDetailByPayTransSerialNoStatusSucc(String serialNo);

    void updateRepayStatusToFaild(String createTime);

    List<ProductInfo> selectCreditAccountProduct(String custNo);

    RepaymentOrder getRepaymentOrderByPayTrans(RepaymentOrder repaymentOrderSql);

    void updateRepayStatusToFaildByPayTransSerialNo(String walletNo);

    RepaymentOrder getOneByPayTransSerialNo(String batchSerialNo);

    @Select("${sqlStr}")
    List<RepaymentOrder> dealBySqlStr(@Param("sqlStr") String sqlStr);


}
